import './links.html';

import '../components/data_table/data_table.js';

import { Links } from '/imports/api/links/links.js';


Template.Admin_Links.helpers({
	
	modelname(){
		return '链接';
	},
	tableheads(){
		return ['名称', 'URL','区域', '组别', '权重', '创建日期'];
	},
	subsReady(){
		return 'onepage.links';
	},
	modelmethods(){
		return {
			delete: "links.delete",
			create: "links.insert",
			update: "links.update"
		}
	},
	render(modelname, tableheads, subsReady, modelmethods) {
		return {
			modelname,
			tableheads,
			subsReady,
			model: Links,
			modelmethods
		};
	},

	renderCreateModal(title, createForm){
		return {
			title
		}
	},

	title(){
		return '新建链接';
	},

	createForm(){
		return 'new_link_form';
	}

})